<?php
namespace daswork;

use mysqli;

class Connect
{
    protected $connect;

    public function __construct()
    {
        $mydb = new mysqli('127.0.0.1', 'root', '123456', 'test');
        if ($mydb->connect_error) {
            throw new \Exception('Connect Error (' . $mydb->connect_errno . ') '. $mydb->connect_error);
        } else {
            // echo "Opened database successfully\n";
            $this->connect = $mydb;
        }
    }
}